package com.eliota.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.eliota.entity.RoleMenu;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author M.G
 * @create 2023-03-29 15:35
 * @date 2023/3/29 15:35
 */

@Mapper
public interface RoleMenuMapper extends BaseMapper<RoleMenu> {

    @Delete("delete from role_menu where role_menu.role_id = #{roleId}")
    int deleteByRoleId(Integer roleId);

    @Select("select role_menu.menu_id  from role_menu where role_id = #{roleId}")
    List<Integer> getMenuByRoleId(Integer roleId);

}
